<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <base th:href="${#request.getContextPath() + '/webcon/resources/'}"/>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title></title>
    <link rel="stylesheet" href="layui/css/layui.css">
    <link rel="stylesheet" href="css/main.css">

    <script src="js/jquery-3.5.0.min.js"></script>
    <script src="layui/layui.js"></script>

    <script type="text/javascript" th:src="${#request.getContextPath() + '/commons/js/myajax.js'}"></script>
    <script type="text/javascript" th:src="${#request.getContextPath() + '/commons/js/mytask_status.js'}"></script>

    <script th:src="${#request.getContextPath() + '/commons/js/mylogo.js'}"></script>

</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <div class="layui-header" style="background-color: #EBEBEB;left: 200px;line-height: 60px;">
        <span class="title">终端状态</span>
        <span class="sysname">Welcome to Audio and Video System</span>
        <span onclick="logout()" class="logout"><i class="layui-icon">&#xe682;</i>退出</span>
    </div>

    <div class="layui-side layui-bg-cyan" style="top: 0;overflow-y: hidden;">
        <div class="logo">
            <img id="mylogo" src="/logo/logo.png"/>
           <!-- <span class="username" th:text="${#session.getAttribute(T(com.video.commons.loginaop.LoginContact).WEBCON_USER.getKey()).getNickname()}">ADMIN-GOOD</span>-->
        </div>
        <div class="layui-side-scroll" th:with="pageProxy = ${#session.getAttribute(T(com.video.commons.loginaop.LoginContact).WEBCON_USER.getKey()).getProxy()}">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree layui-bg-cyan layui-tab"  lay-filter="test">
                <li class="layui-nav-item layui-nav-itemed">
                    <a class="" href="javascript:;"><i class="layui-icon">&#xe653;</i> 终端管理</a>
                    <dl class="layui-nav-child">
                        <dd class="layui-this"><a href="javascript:;" page="/client/listByWebcon">终端状态</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item" th:if="${#strings.indexOf(pageProxy, '1') != -1 || #strings.indexOf(pageProxy, '2') != -1}">
                    <a href="javascript:;"><i class="layui-icon">&#xe652;</i> 音乐系统</a>
                    <dl class="layui-nav-child">
                        <dd><a th:if="${#strings.indexOf(pageProxy, '1') != -1}" href="javascript:;" page="/toWebconPage/task_realmusic">实时音乐</a></dd>
                        <dd><a th:if="${#strings.indexOf(pageProxy, '2') != -1}" href="javascript:;" page="/toWebconPage/task_timemusic">定时音乐</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item" th:if="${#strings.indexOf(pageProxy, '3') != -1}">
                    <a href="javascript:;"><i class="layui-icon">&#xe68d;</i> 定时采集</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:;" page="/toWebconPage/task_collection">定时采集</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item" th:if="${#strings.indexOf(pageProxy, '4') != -1}">
                    <a href="javascript:;"><i class="layui-icon">&#xe667;</i> 消防报警</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:;" page="/toWebconPage/task_fire">消防报警</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item" th:if="${#strings.indexOf(pageProxy, '5') != -1}">
                    <a href="javascript:;"><i class="layui-icon">&#xe6dc;</i> 语音合成</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:;" page="/toWebconPage/task_voice">语音合成</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item" th:if="${#strings.indexOf(pageProxy, '6') != -1 || #strings.indexOf(pageProxy, '7') != -1}">
                    <a href="javascript:;"><i class="layui-icon">&#xe691;</i> 实时寻呼</a>
                    <dl class="layui-nav-child">
                        <dd><a th:if="${#strings.indexOf(pageProxy, '6') != -1}" href="javascript:;" page="/toVideoPage/video_more">实时寻呼</a></dd>
                        <dd><a th:if="${#strings.indexOf(pageProxy, '7') != -1}" href="javascript:;" page="/toVideoPage/video_one">双向对讲</a></dd>
                    </dl>
                </li>
        </div>
    </div>

    <div class="layui-body" style="overflow-y: hidden;height: 100%;padding-bottom: 60px;">
        <!-- 内容主体区域 -->
        <iframe src='/client/listByWebcon' name='myFrame' id='myIframe' width='100%' height='100%' scrolling='auto' frameborder='0'></iframe>

    </div>
</div>

<script>
    $(".layui-nav-child dd a").click(function(){
        let title=$(this).text()
        $(".title").text(title)
        let url=$(this).attr("page")
        console.log(url)
        $("#myIframe").attr("src", url)

    })
    $('.layui-nav-item').click(function(){
        $(this).siblings('li').attr('class','layui-nav-item');
    })

    layui.use(['element','table','layer'], function(){
        var element = layui.element;
        var table = layui.table;
        var layer = layui.layer;
        element.on('tab(test)', function(data){
            console.log(data);
        });
    });
    function logout(){
        layer.confirm('确定要退出吗?', {icon: 3, title:'系统提示'}, function(index){
            //注销
            location.href = "/webcon/logout";
            layer.close(index);
        });
    }
</script>
</body>
</html>
